<template>
  <el-dialog
    title="扫描任务"
    :visible.sync="centerDialogVisible"
    width="30%"
    center
  >
    <span>请稍等...</span>
    <el-progress :text-inside="true" :stroke-width="26" :percentage="money_progress"></el-progress>
    <div slot="footer" class="dialog-footer">
      <el-button @click="centerDialogVisible = false">隐藏</el-button>
      <el-button type="primary" @click="centerDialogVisible = false"
        >确 定</el-button
      >
    </div>
  </el-dialog>
</template>

<script>
import axios from 'axios'
export default {
  data() {
    return {
      money_progress: '',
      centerDialogVisible: false,
    }
  },
  methods: {
    show() {
      this.centerDialogVisible = true
    },
    hide() {
      this.centerDialogVisible = false
    },
    handleClose(done) {
      this.$confirm('确认关闭？')
        .then((_) => {
          done()
        })
        .catch((_) => {})
    },
  },
  mounted() {
    const url = 'http://localhost:5000/money_task'
    setInterval(()=>{axios.get(url).then(response => {
      const result = response.data
      this.money_progress = result.money_progress
    })},8000)
  }
}
</script>

<style lang="scss" scoped>
</style>
